(function($){
	$(document).ready(function(){

		$("#id_company").change(function(e){
			var group_name = $('#id_name').val();
			var company = $('#id_company option:selected').text();
			var name = group_name
			if (group_name.indexOf(' --- ') > -1){
				name = group_name.split(' --- ')[1]
			}
			$('#id_name').val(company + ' --- ' + name);
		});
			
	});
})(django.jQuery);
